﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;

namespace ZombieMonkeys.Vibria.GUI
{
    public partial class MainPage : PhoneApplicationPage
    {
        /// <summary>
        /// Constructor for the main page
        /// </summary>
        public MainPage()
        {

            InitializeComponent();
        }

        /// <summary>
        /// Sends user to the about page
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button9_Click(object sender, RoutedEventArgs e)
        {
            Uri about = new Uri("/About.xaml", UriKind.Relative);
            NavigationService.Navigate(about);
        }

        /// <summary>
        /// Sends user to the easy puzzle 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void easyButton_Click(object sender, RoutedEventArgs e)
        {
            //difficulty to pass in to the puzzle page
            string parameter = "Easy";

            Uri puzzle = new Uri(string.Format("/GridView.xaml?parameter={0}", parameter), UriKind.Relative);
            NavigationService.Navigate(puzzle);
        }

        /// <summary>
        /// Sends user to the moderate puzzle page
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void moderateButton_Click(object sender, RoutedEventArgs e)
        {
            //difficulty to pass in to the puzzle page
            string parameter = "Moderate";

            Uri puzzle = new Uri(string.Format("/GridView.xaml?parameter={0}", parameter), UriKind.Relative);
            NavigationService.Navigate(puzzle);
        }

        /// <summary>
        /// Sends user to the hard puzzle page 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void hardButton_Click(object sender, RoutedEventArgs e)
        {
            //difficulty to pass in to the puzzle page
            string parameter = "Hard";

            Uri puzzle = new Uri(string.Format("/GridView.xaml?parameter={0}", parameter), UriKind.Relative);
            NavigationService.Navigate(puzzle);
        }

        /// <summary>
        /// Sends user to the super hard puzzle
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void superHardButton_Click(object sender, RoutedEventArgs e)
        {
            //difficulty to pass in to the puzzle page
            string parameter = "Super Hard";

            Uri puzzle = new Uri(string.Format("/GridView.xaml?parameter={0}", parameter), UriKind.Relative);
            NavigationService.Navigate(puzzle);
        }

        /// <summary>
        /// Sends user to the load game page
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void loadButton_Click(object sender, RoutedEventArgs e)
        {
            Uri load = new Uri(string.Format("/Load.xaml"), UriKind.Relative);
            NavigationService.Navigate(load);
        }

        /// <summary>
        /// Sends user to the puzzle solver page
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void solverButton_Click(object sender, RoutedEventArgs e)
        {
            //right now the solver page is just a regular puzzle page and we pass in the solve value
            string parameter = "Solve";

            Uri puzzle = new Uri(string.Format("/GridView.xaml?parameter={0}", parameter), UriKind.Relative);
            NavigationService.Navigate(puzzle);
        }

        /// <summary>
        /// Sends user to the scores page
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void scoreButton_Click(object sender, RoutedEventArgs e)
        {
            Uri scores = new Uri(string.Format("/Scores.xaml"), UriKind.Relative);
            NavigationService.Navigate(scores);
        }

        /// <summary>
        /// Sends user to the options page
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void optionsButton_Click(object sender, RoutedEventArgs e)
        {
            Uri options = new Uri(string.Format("/OptionsPage.xaml"), UriKind.Relative);
            NavigationService.Navigate(options);
        }
    }
}